//
//  XDHomeVideoCell.m
//  XDEducation
//
//  Created by apple on 2017/4/8.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "XDHomeVideoCell.h"
#import <SDWebImage/UIButton+WebCache.h>
#import "XDVideoModel.h"
@interface XDHomeVideoCell ()
@property (weak, nonatomic) IBOutlet UIButton *videoBtnLeft;
@property (weak, nonatomic) IBOutlet UILabel *videoTitleLeft;
@property (weak, nonatomic) IBOutlet UIButton *videoBtnRight;
@property (weak, nonatomic) IBOutlet UILabel *videoTitleRight;


/** 左边视频模型 */
@property(nonatomic,strong) XDVideoModel *modelLeft;
/** 右边视频模型 */
@property(nonatomic,strong) XDVideoModel *modelRight;


@end

@implementation XDHomeVideoCell


-(void)setVideoArr:(NSMutableArray *)videoArr{

    _videoArr = videoArr;
    
//    _modelLeft = videoArr[0];
//    _modelRight = videoArr[1];
    
    [self.videoBtnLeft sd_setBackgroundImageWithURL:[NSURL URLWithString:_modelLeft.absoluteImg] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"video_image_default"]];
    
    self.videoTitleLeft.text = _modelLeft.title;
    
    [self.videoBtnRight sd_setBackgroundImageWithURL:[NSURL URLWithString:_modelRight.absoluteImg] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"video_image_default"]];
    
    self.videoTitleRight.text = _modelRight.title;
}

- (IBAction)videoLeftBtnClicked:(id)sender {
    
    if (self.videoClickedBlock) {
        self.videoClickedBlock(_modelLeft);
    }
}

- (IBAction)videoRightBtnClicked:(id)sender {
    
    if (self.videoClickedBlock) {
        self.videoClickedBlock(_modelRight);
    }
}

@end
